package com.itheima02.day04.dao;

import com.itheima02.day04.domain.Student;
import com.itheima02.day04.domain.Teacher;

import java.util.ArrayList;

/**
 * @author 刘全
 * @date 2021/7/19
 */
public class StudentDao {
    Student stu = new Student();
    static ArrayList<Student> stuList = new ArrayList<>();
    static Teacher[] arr = new Teacher[5];

    public boolean OnLine(String s, String num) {
        boolean b = s.equals(stu.getUserName()) && num.equals(stu.getPassWord());
        return b;
    }

    public boolean addStudent(Student student) {
        return stuList.add(student);
    }

    public boolean isExist(String id) {
        for (int i = 0; i < stuList.size(); i++) {
            if (id.equals(stuList.get(i).getId())) {
                return true;
            }
        }
        return false;
    }

    public ArrayList<Student> checkStudent() {
        return stuList;
    }

    public ArrayList<Student> deleteStudent() {
        return stuList;
    }

    public int getListSize() {
        return stuList.size();
    }

    public ArrayList<Student> setStudent() {
        return stuList;
    }

    public Teacher[] addTeacher() {
        return arr;
    }

    public Teacher[] checkTeacher() {
        return arr;
    }

    public Teacher[] getArr() {
        return arr;
    }

    public Teacher[] deleteTeacher() {
        return arr;
    }
}
